tools/xenpaging: fix return value from xc_mem_paging_flush_ioemu_cache
authorIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 11 Jan 2011 16:48:09 +0000 (16:48 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 11 Jan 2011 16:48:09 +0000 (16:48 +0000)
commit4e86bc34ad901c578d71b0fdb5e14eb591ef7811
tree67d62427d64438c43805d10cc494c4d3caa17582
parent1676d94292f97fa86fcafa6348ac57d12c270054
tools/xenpaging: fix return value from xc_mem_paging_flush_ioemu_cache

While using xenpaging, "Error flushing ioemu cache" message will be
shown even if the "flush-cache" command is sent to xenstore correctly.
That is because xenpaging assumes xc_mem_paging_flush_ioemu_cache()
returns non-zero value when the operation fails.  But
xc_mem_paging_flush_ioemu_cache() returns the return value from
xs_write() which is zero on error.

So, we should invert the return value from xs_write() and return -1 on
error, or 0 on success, like other xc_ functions.

Signed-off-by: Han-Lin Li <Han-Lin.Li@itri.org.tw>
Author: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/xenpaging/xc.c